﻿@using Seal.Model;
@{
    SecurityProvider provider = Model;

    //Parameters for this provider
    provider.Script = @"@{
    SecurityUser user = Model;
	//Basic authentication script: use the user name and password to authenticate the user and set his name and security groups...
	//user.WebUserName -> user name from the login screen
	//user.WebPassword -> password from the login screen

	user.Name = user.WebUserName; //Display name
	//user.PersonalFolderName -> may be set to defined the personal folder name

	//Authenticate and set the groups defined in the security login
	if (!user.LoginAuthentication(user.WebUserName, user.WebPassword)) {
		throw new Exception(""Invalid user name or password"");
	}

    //or security check can be hardcoded
	/*
	if (user.WebUserName == ""userName"" && user.WebPassword == ""password"")
	{
		user.AddDefaultSecurityGroup();
		//user.AddSecurityGroup(""aGroupName"");
	}*/

}";    
}
